<if condition="$async eq 1">
	<script type="text/javascript">
	// 动态加载
	$(document).ready(function(){
		var url = "{:U('home/Widget/renderWidget')}";
		$.post(url, {name:'RelatedUser',param:'{$param}'}, function(res){
			$('#_widget_relate_user').html(res);
		});
	});
	</script>
	<span id="_widget_relate_user"></span>
<else />
	<div class="right_box">
	    <h2><span class="right fn f12px"><a href="javascript:void(0);" onclick="replace_user('{$limit}');">换一换</a></span>{$title}</h2>
	    <ul class="interest_person" id="related_user">
	        <php>for ( $i = 0; $i < $limit; $i++ ) {</php>
	        <php>
	            $vo = array_shift($user);
	            if (empty($vo)) break;
	        </php>
	        <li id="related_user_{$vo['uid']}">
	            <div class="userPic"><a title="" href="{:U('home/Space/index',array('uid'=>$vo['uid']))}">
	                <img src="{$vo['uid']|getUserFace='m'}" card="1">
	            </a></div>
	            <div class="interest_info">
	            <p><space uid="vo.uid" class="fn">{uname}</space></p>
	          	<p><a href="javascript:void(0);" onclick="subscribe({$vo['uid']});" class="guanzhu">加关注</a></p>
	          <p class="cGray2">{$vo['reason']}</p></div>
	        </li>
	        <php>}</php>
	    </ul>
	    <php>$_SESSION['_widget_related_user'] = serialize($user);</php>
	</div>
	
	<script type="text/javascript">
	    function subscribe(uid) {
	        $.post("{:U('home/Widget/doFollowRelatedUser')}", {uid:uid}, function(res){
	            if ('0' == res) {
	                ui.success('关注失败');
	            }else {
	    			followGroupSelectorBox(uid);
	                $('#related_user_'+uid).remove();
	                $('#related_user').append(res);
	            }
	        });
	    }
	    
	    function replace_user(limit){
	    	$.post("{:U('home/Widget/replaceRelatedUser')}", {limit:limit}, function(res){
	            if ('0' == res) {
	                ui.success('没有更多的用户了');
	            }else {
	                $('#related_user').html('');
	                $('#related_user').html(res);
	            }
	        });
	    }
	</script>
</if>